﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EngineAdmin
{
    /// <summary>
    /// The main engine class
    /// </summary>
    public class Engine
    {
        private ComputerEngine.Engine _computerEngine = null;

        internal ComputerEngine.Engine InternalEngine
        {
            get
            {
                return _computerEngine;
            }
            set
            {
                _computerEngine = value;
            }
        }      

        /// <summary>
        /// Constructor
        /// </summary>
        public Engine(EngineConfig config)
        {
            EngineConfiguration = config;
        }

        /// <summary>
        /// Closes the engine - terminates the threads
        /// </summary>
        internal void CloseEngine()
        {
            if (EngineConfiguration.EngineType == eEngineType.Internal)
            {
                _computerEngine.TerminateComputer();
            }
            else if (EngineConfiguration.EngineType == eEngineType.CheckersBoard)
            {
                throw new NotImplementedException();
            }
        }

        /// <summary>
        /// Engine configuration
        /// </summary>
        public EngineConfig EngineConfiguration
        { get; private set; }          
    }
}
